<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
   import="java.util.*,com.beans.*,com.DAO.*;" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Update Category</title>

</head>
<body>
<%!int id1=0; 
 String checkValue;%>
 <div class = "categorytitle">
 	Update Category
 </div>
 
 <div class = "categorycontent">
 <center>

<form action="UpdateCategoryAction.do">
<%
CategoryDAO categoryDao=new CategoryDAO();
CategoryForm categoryForm = new CategoryForm();
id1=Integer.parseInt(request.getParameter("id"));
categoryForm=categoryDao.getCategoryInfo(id1);

%>	

Category Name:<input  type="text" name="name" value="<%= categoryForm.getName() %>"/><br>
<br>
Allow Comments:<% if(categoryForm.getAllowComment().equals("T")) 
{
%>
<select name="allowComment"	>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
<% } else {	
%>
<select name="allowComment"	>
<option value="no">No</option>
<option value="yes">Yes</option>
</select>
<%} session.setAttribute("updateid",id1);
%>
<br><br>
<input id = "btnedit" type="submit" name="save" value="Edit"/>

</form>
</center>
</div>
</body>
</html>